package org.apache.james.hibernate;

import java.io.IOException;
import java.io.OutputStream;

public class CounterOutputStream extends OutputStream {
	int size;
	
	public int getSize() {
		return size;
	}

	@Override
	public void write(int b) throws IOException {
		size++;
	}
	@Override
	public void write(byte[] b) throws IOException {
		size += b.length;
	}
	
	@Override
	public void write(byte[] b, int off, int len) throws IOException {
		size+= len;
	}

}
